package org.hako.recite.word.model;

import java.util.Arrays;

/**
 * Word. Use string array to store fields.
 * 
 * @since 0.4.0
 * @author xnnyygn
 */
public class Word {

	private String[] fields;

	/**
	 * Create
	 * 
	 * @param fields
	 */
	public Word(String... fields) {
		this.fields = fields;
	}

	/**
	 * Get field value of word.
	 * 
	 * @param fieldIndex
	 *            field index
	 * @return
	 */
	public String get(int fieldIndex) {
		return fields[fieldIndex];
	}

	/**
	 * Get fields.
	 * 
	 * @return
	 */
	public String[] getFields() {
		return fields;
	}

	@Override
	public String toString() {
		return "Word{" + Arrays.toString(fields) + '}';
	}

}
